CanvasRenderingContext2D.prototype.fillSky = function(x0, y0, x1, y1) {

    var gbColor = this.createLinearGradient(0, y0, 0, y1);
    //var gbColor = this.createRadialGradient(WINDOW_WIDTH/2,WINDOW_HEIGHT,WINDOW_HEIGHT,WINDOW_WIDTH/2,WINDOW_HEIGHT,0);
    gbColor.addColorStop(0, "black");
    gbColor.addColorStop(1, "#058");
    this.fillStyle = gbColor;
    this.fillRect(x0, y0, x1, y1);

}


CanvasRenderingContext2D.prototype.fillStar = function(x,y,R, m,a){
    this.save();
    this.translate(x,y);
    this.rotate(a *Math.PI/180);
    this.scale(m,m);
    this.beginPath();
    //当两条线条交汇时，创建圆形边角：
    this.lineJoin="round";
    for(var  i = 0 ;i < 5 ; i++){
        this.lineTo(Math.cos((18 + 72* i)/ 180 * Math.PI)*0.382*R, Math.sin((18 + 72* i) / 180* Math.PI)*0.382*R);
        this.lineTo(Math.cos((54 + 72* i)/180* Math.PI)*R, Math.sin((54 + 72* i) / 180* Math.PI)* R);
    }
    this.closePath();
    this.fillStyle="yellow";
    this.fill();
    this.restore();
}

CanvasRenderingContext2D.prototype.fillMoon = function(x,y,a){
    this.save();
    this.translate(x,y);
    this.rotate(a *Math.PI/180);
    this.beginPath();
    this.moveTo(0,0);
    this.bezierCurveTo(50,50,50,50,0,100);
    this.bezierCurveTo(100,100,100,0,0,0);
    this.closePath();
    this.fillStyle="yellow";
    this.fill();
    this.restore();
}
CanvasRenderingContext2D.prototype.fillLand = function(x,y){
    this.save();
    this.translate(0,0.8 * y);
    this.beginPath();
    this.moveTo(0,0);
    //三次贝塞尔曲线
    this.bezierCurveTo(x * 0.25, - y * 0.25,x * 0.75, y * 0.25 ,x,0);
    this.lineTo(x,y * 0.2);
    this.lineTo(0,y * 0.2);
    this.closePath();
    var gbColor = this.createLinearGradient(0, 0, 0, y);
    gbColor.addColorStop(0, "#0ad101");
    gbColor.addColorStop(1, "green");
    this.fillStyle=gbColor;
    this.fill();
    this.restore();
}